﻿using System;

namespace CS_2_1
{
    class Program
    {
        //计算兔子每月新增函数
        static int New_Rabbit_Of_Month(int n)
        {
            //一月1只兔子
            if (n == 1)
            {
                return 1;
            }
            //二月未新出生
            else if (n == 2)
            {
                return 0;
            }
            //后续每月新增为前两月之和
            else
            {
                return New_Rabbit_Of_Month(n - 1) + New_Rabbit_Of_Month(n - 2);
            }
        }

        static void Main(string[] args)
        {
            Console.Write("输入月份：");
            int n = int.Parse(Console.ReadLine());
            int sum_Rabbit_Of_Month = 0;
            for (int i = 1; i <= n; i++)
            {
                //循环增加每月新增兔子，求和
                sum_Rabbit_Of_Month += New_Rabbit_Of_Month(i);
            }
            Console.WriteLine("第" + n + "个月共有" + sum_Rabbit_Of_Month + "对兔子");
            Console.ReadLine();
        }
    }
}